home *** CD-ROM | disk | FTP | other *** search
- #ifndef lint
- static const char sccsid[] = "%Z%%I% %G% %U% %W%";
- #endif
- /*
- * COMPONENT_NAME: (RTTI) Run-Time Type System for C++
- *
- * FUNCTIONS:
- *
- * ORIGINS: 27
- *
- * (C) COPYRIGHT International Business Machines Corp. 1992
- * This work was supported by a grant from International Business
- * Machines, Inc. These procedures are contributed to the public domain
- * by International Business Machines Inc. "AS IS" without any warranty
- * of any kind including the warranty of merchantability or fitness
- * for a particular purpose.
- *
- *
- * This is free software. Feel free to redistribute and/or modify it.
- * Please send us e-mail and let us know if you have any problems
- * or suggestions.
- *
- * Arindam Banerji
- * axb@cse.nd.edu
- *
- */
-
-
- #include "rtti_entry.h"
- int class_count = 0 ;
-
- int do_ptr_cast(const Type_info *a, const Type_info *b)
- {
- return (a->can_cast(b)) ;
- }
-
-
- /*****
- SCAFFOLDING NECESSARY TO SUPPORT RTTI
- ******/
-
- const hndl_recursion CLASS::info_obj ;
- const Type_info temporary_base("CLASS", 0 ) ;
-
- const Type_info *
- hndl_recursion::convert_type() const
- {
- return ( &temporary_base ) ;
- } // returns a void pointer to itself
-
- const Type_info *
- hndl_recursion::operator & ()
- {
- return (&temporary_base) ;
- } // hack
-
- // const Type_info CLASS::info_obj("CLASS",0) ;
-
- // This is a function that returns the dynamic type of a class.
- typeid
- CLASS::get_info() const
- {
- return ((const Type_info *) (info_obj.convert_type())) ;
- } // dynamic_type()
-
- // This is a static function that returns the static type of a class.
- typeid
- CLASS::info()
- {
- return ((const Type_info *) (info_obj.convert_type())) ;
- } // static_type()
-
-